ImageGear Professional > User Guide > Using ImageGear > Displaying Images > Understanding Display Options > Transparency and Background |
The ImageGear display functionality supports transparency by color and by mask. The former means that it is possible to draw images with the specified color being transparent. The latter allows using a specified 1-bit per pixel image as the transparent mask. There are a few options related to transparency and background support:
TranspMode (AT_MODE) |
Option that contains transparency flags. If its value is IG_DSPL_TRANSPARENCY_NONE then transparency is disabled. Each of the following flags enables some transparency-related features:
The next three flags are exclusive; only one of them can be set at a time:
The default value for TranspMode option is IG_DSPL_TRANSPARENCY_NONE, which means that transparency is disabled. |
TranspColor (AT_RGB) | This (RGB) triple specifies the transparent color, and it is used if the IG_DSPL_TRANSPARENCY_COLOR flag is set in TranspMode (see its description above). If the transparent color is enabled, then all the pixels in the image that have values equal to TranspColor are drawn as transparent. |
TranspMask (HIGEAR) | This option specifies the transparency mask, and it is used if the IG_DSPL_TRANSPARENCY_MASK flag is set (see the TranspMode's description above). This is a normal HIGEAR image, and its location on the screen depends on other flags described above and the MaskLocation option. The application code is responsible for creating and deleting this mask. |
MaskRect (AT_RECTANGLE) | This rectangle specifies which part of the TranspMask image should be used as the transparency mask. It is an analog of the original image's ImageRect, but it applies to the TranspMask image. By default, it is initialized with the empty rectangle, which means the complete TranspMask image will be used. |
MaskLocation (AT_POINT) | This option specifies how the transparency mask is located relative to either the image or the device, depending on the flags set in TranspMode. |
BkMode (AT_MODE) |
This option specifies how ImageGear should fill the area of ClientRect that is not covered by the image's pixels. If its value is IG_DSPL_BACKGROUND_NONE, then the background is disabled, and ImageGear does not fill this area. Other possible values are as follows:
The default value for this option is IG_DSPL_BACKGROUND_UNDER_IMAGE| IG_DSPL_BACKGROUND_BEYOND_IMAGE. |
BkColor (AT_RGB) | This option is a (RGB) triple that specifies the background color. This color is used to fill the area of ClipRect that is not covered by the image's pixels. |
BkBrush (HBITMAP) | This option is the handle of the bitmap that stores the brush to be used. The application code is responsible for creating and deleting this brush. |